<?php
namespace app\index\controller;

use think\Controller;
class Lists extends Controller
{
   public function getList()
   {
       $page = request()->get('page',1);
       $limit = request()->get('limit',10);

       $r_name = request()->get('r_name','');
       $s_status = request()->get('s_status','');

       $where = [];
       if( $r_name != '' || $r_name != null)
       {
            $where['r_name'] = array('like',"%$r_name%");
       }

       if($s_status != '' || $s_status != null  )
       {
            $where['status'] = array('like',"%$s_status%");
       }

       $res  = model('Role') -> getLists($where,$page,$limit);

       if(!$res)
           {
            return json(array('code'=>1,'msg'=>'数据错误!!!!','data'=>''));
           }

           return json(array('code'=>0,'msg'=>"OK",'data'=>$res));
   }
}
?>